< previous page page_85 next page >

Page 85
would draw them on the form. You need to make sure that the cursor is inside the frame when you start drawing the control. Otherwise, the control is not contained by the frame. Figure 4.20 shows several controls for a personnel application drawn on a frame.
0085-01.jpg
Figure 4.20
Make sure your cursor is inside the
frame before you start to draw a control.
Here are a couple of points about controls and frames:
First, if you already have controls on the form, they are not contained by the frame, even if you draw the frame over the control.
Second, when you are moving a control on a frame, unlike moving controls around on a form, you cannot move a control into or out of the frame by dragging and dropping the control.
You can drag a control over the frame, and the control will look like it is contained within the frame, but it really isn't. The only way to move a control from other parts of the form into the frame is to cut and paste. Cut the control from the form, select the frame, and then paste the control in the frame. (You can also copy a control from another part of the form and paste it into the frame.) The control is initially placed in the upper-left corner of the frame, but after the control is in the frame, you can drag and drop the control within the frame. You can use the same technique to move a control out of the frame. You can, of course, move multiple controls at the same time.
tip.gif
If you want to make sure a control is in the frame, try moving the frame. If the control moves with it, the control is part of the frame. If the control does not move with the frame, you can cut and paste to move it into the frame.

Working with Multiple Controls at Designtime
So far, you have seen how to add controls to your forms and how to set the properties of a single control at a time. Sometimes, though, you need to be able to work with multiple controls at the same time. For example, if you have a bunch of Label controls on a form and decide to

 
< previous page page_85 next page >